package com.bjpowernode.query;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 接收用户查询参数
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserQuery {
    private Integer id;

    @NotEmpty(message = "登录账号不能为空")
    @Size(min = 3, max = 30, message = "登录账号长度必须在3到30之间")
    private String loginAct;

    @NotEmpty(message = "登录密码不能为空")
    @Size(min = 6, max = 16, message = "登录密码长度必须在6到16之间")
    private String loginPwd;

    @NotEmpty(message = "姓名不能为空")
    @Size(min = 2, max = 10, message = "姓名至少是两个字符")
    @Pattern(regexp = "/^[\\u4e00-\\u9fa5]+$/", message = "姓名必须是中文汉字")
    private String name;

    @NotEmpty(message = "手机号不能为空")
    @Size(min = 11, max = 11, message = "手机号长度必须是11位")
    @Pattern(regexp = "/^1(3|4|5|6|7|8|9)\\d{9}$/", message = "手机号码格式有误")
    private String phone;

    @NotEmpty(message = "邮箱不能为空")
    @Email(message = "邮箱格式有误")
    private String email;

    @NotEmpty(message = "账号是否过期不能为空")
    private Integer accountNoExpired;

    @NotEmpty(message = "密码是否过期不能为空")
    private Integer credentialsNoExpired;

    @NotEmpty(message = "账号是否锁定不能为空")
    private Integer accountNoLocked;

    @NotEmpty(message = "账号是否启用不能为空")
    private Integer accountEnabled;
}
